<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
/*
  | -------------------------------------------------------------------------
  | URI ROUTING
  | -------------------------------------------------------------------------
  | This file lets you re-map URI requests to specific controller functions.
  |
  | Typically there is a one-to-one relationship between a URL string
  | and its corresponding controller class/method. The segments in a
  | URL normally follow this pattern:
  |
  |	example.com/class/method/id/
  |
  | In some instances, however, you may want to remap this relationship
  | so that a different class/function is called than the one
  | corresponding to the URL.
  |
  | Please see the user guide for complete details:
  |
  |	http://codeigniter.com/user_guide/general/routing.html
  |
  | -------------------------------------------------------------------------
  | RESERVED ROUTES
  | -------------------------------------------------------------------------
  |
  | There area two reserved routes:
  |
  |	$route['default_controller'] = 'welcome';
  |
  | This route indicates which controller class should be loaded if the
  | URI contains no data. In the above example, the "welcome" class
  | would be loaded.
  |
  |	$route['404_override'] = 'errors/page_missing';
  |
  | This route will tell the Router what URI segments to use if those provided
  | in the URL cannot be matched to a valid route.
  |
 */

$route['default_controller'] = "tangiakhang";
$route['404_override'] = '';

$route['(gioi-thieu|tu-van-kien-truc|dich-vu|lien-he)'] = 'tangiakhang/index/$1';
$route['(lien-he)/(:any)'] = 'tangiakhang/index/$1/$2/$3';
$route['(lien-he)/(:any)/(:any)'] = 'tangiakhang/index/$1/$2/$3';

$route['(du-an|nha-mau|noi-ngoai-that|nha-dat|tin-tuc)'] = 'tangiakhang/loadSameContent/$1';

$route['(du-an|nha-mau|noi-ngoai-that|nha-dat|tin-tuc)/chi-tiet/(:any)'] = 'tangiakhang/infoItem/$1/sub_category/$2';
$route['(du-an|nha-mau|noi-ngoai-that|nha-dat|tin-tuc)/(:any)/chi-tiet/(:any)'] = 'tangiakhang/infoItem/$1/$2/$3';

$route['(du-an|nha-mau|noi-ngoai-that|nha-dat|tin-tuc)/(:any)'] = 'tangiakhang/loadSameContent/$1/$2';
$route['(du-an|nha-mau|noi-ngoai-that|nha-dat|tin-tuc)/(:any)/(:any)'] = 'tangiakhang/loadSameContent/$1/$2/$3';

$route['admin'] = "admin/login";
$route['admin/(trang-chu|lien-he|du-an|nha-mau|gioi-thieu|tin-tuc|nha-dat|noi-ngoai-that|login)'] = "admin/index/$1";
$route['admin/(login)/(submit|sign-out)'] = "admin/index/$1/$2";
$route['admin/(tin-tuc|lien-he|nha-mau|du-an|gioi-thieu|noi-ngoai-that|nha-dat)/(add)'] = "admin/index/$1/$2";
$route['admin/(tin-tuc|lien-he|nha-mau|du-an|gioi-thieu|noi-ngoai-that|nha-dat)/(:any)/(edit)'] = "admin/index/$1/$3/action/$2";
$route['admin/(tin-tuc|lien-he|nha-mau|du-an|gioi-thieu|noi-ngoai-that|nha-dat)/(:any)/(edit)/(submit)'] = "admin/index/$1/$3/$4/$2";
$route['admin/(tin-tuc|lien-he|nha-mau|du-an|gioi-thieu|noi-ngoai-that|nha-dat)/(add|delete)/(submit)'] = "admin/index/$1/$2/$3";
/* End of file routes.php */
/* Location: ./application/config/routes.php */